<?php

namespace App\Http\Controllers\Home;

use App\Models\Message;
use Illuminate\Http\Request;

class IndexController extends CommonController
{

    /**
     * 查询留言列表
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $data = Message::orderBy('id', 'desc')->paginate(3);
        return view('home.index.index', compact('data', 'new'));
    }

    /**
     * 查看留言
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        $field = Message::find($id);
        return view('home.index.show', compact('field'));
    }
}
